//
//  SelectedTopicInsidePagesViewController.m
//  DefendHealth
//
//  Created by 吾诺翰卓003 on 17/2/20.
//  Copyright © 2017年 iMacOne. All rights reserved.
//

#import "SelectedTopicInsidePagesViewController.h"
#import "HotCircleTableViewCell.h"
@interface SelectedTopicInsidePagesViewController ()

@end

@implementation SelectedTopicInsidePagesViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.TitleNav.text = @"敢秀才精彩";
    self.baseTableView.frame = CGRectMake(0, 64, WindowWidth, WindowHeight-64);
    [self addHeadView];
    UIButton *releaseBtn = [[UIButton alloc] initWithFrame:CGRectMake(WindowWidth-10-[ToolUtil autoWidth:@"发布" width:500 height:13 num:13], 20, [ToolUtil autoWidth:@"发布" width:500 height:13 num:13], 44)];
    [releaseBtn setTitle:@"发布" forState:UIControlStateNormal];
    [releaseBtn addTarget:self action:@selector(release:) forControlEvents:UIControlEventTouchUpInside];
    releaseBtn.titleLabel.font = FONT(13);
    releaseBtn.titleLabel.textAlignment = 2;
    [releaseBtn setTitleColor:[ImageUtil colorWithRgb:0x333333] forState:0];
    [self.view addSubview:releaseBtn];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)addHeadView{
    UIView *headView1 = [UIView new];
    
    headView1.backgroundColor = [UIColor whiteColor];
    
    
    UIImageView *backImg = [UIImageView new];
    backImg.frame = CGRectMake(0, 0, WindowWidth, 195);
    backImg.backgroundColor = [UIColor grayColor];
    [headView1 addSubview:backImg];
    
    
    UILabel *titile = [UILabel new];
    titile.frame = CGRectMake(0, 75, WindowWidth, 19);
    titile.text = @"敢秀才精彩";
    titile.font = FONT(19);
    titile.textColor = UIColorFromRGB(0x352a28);
    titile.textAlignment = 1;
    [backImg addSubview:titile];
    
    UILabel *content = [UILabel new];
    content.frame = CGRectMake(0, kMaxY(titile.frame)+15, WindowWidth, 11);
    content.text = @"人气：52142";
    content.font = FONT(11);
    content.textColor = UIColorFromRGB(0x352a28);
    content.textAlignment = 1;
    [backImg addSubview:content];
    
    UILabel *contntLab1 = [UILabel new];
    contntLab1.frame = CGRectMake(10, kMaxY(backImg.frame), WindowWidth-20, 80);
    contntLab1.text = @"这里输入内容这里输入内容这里输入内容这里输入内容这里输入内容这里输入内容这里输入内容这里输入内容这里输入内容这里输入内容这里输入内容这里输入内容这里输入内容这里输入内容这里输入内容这里输入内容这里输入内容这里输入内容这里输入";
    contntLab1.font = FONT(10);
    contntLab1.textColor = UIColorFromRGB(0x333333);
    contntLab1.textAlignment = 0;
    contntLab1.numberOfLines = 1000;
    [headView1 addSubview:contntLab1];
    
    NSArray *titleArr = @[@"热门",@"最新"];
    
        BaseView *view1 = [BaseView new];
        view1.frame = CGRectMake((WindowWidth-50-80)/2, kMaxY(contntLab1.frame)+25,40 , 30);
        view1.backgroundColor = [UIColor whiteColor];
        [headView1 addSubview:view1];
    
    UILabel *titlelab1 = [UILabel new];
    titlelab1.frame = CGRectMake(0, 0, 40, 12);
    titlelab1.text = titleArr[0];
    titlelab1.font = FONT(12);
    titlelab1.textColor = UIColorFromRGB(0x333333);
    titlelab1.textAlignment = 1;
    [view1 addSubview:titlelab1];
    
    UIView *hui1 = [UIView new];
    hui1.frame = CGRectMake(0, 27.5,40 , 2.5);
    hui1.backgroundColor = [UIColor blackColor];
    [view1 addSubview:hui1];
    
    BaseView *view2 = [BaseView new];
    view2.frame = CGRectMake(kMaxX(view1.frame)+50, kMaxY(contntLab1.frame)+25,40 , 30);
    view2.backgroundColor = [UIColor whiteColor];
    [headView1 addSubview:view2];
    
    UILabel *titlelab2 = [UILabel new];
    titlelab2.frame = CGRectMake(0, 0, 40, 12);
    titlelab2.text = titleArr[1];
    titlelab2.font = FONT(12);
    titlelab2.textColor = UIColorFromRGB(0x333333);
    titlelab2.textAlignment = 1;
    [view2 addSubview:titlelab2];
    
    UIView *hui2 = [UIView new];
    hui2.frame = CGRectMake(0, 27.5,40 , 2.5);
    hui2.backgroundColor = [UIColor blackColor];
//    [view1 addSubview:hui2];
    
    UIView *hui = [UIView new];
    hui.frame = CGRectMake(0, kMaxY(view2.frame),WindowWidth , 1.5);
    hui.backgroundColor = kLineColor;
//    [headView1 addSubview:hui];
    
    headView1.frame = CGRectMake(0, 0,WindowWidth , kMaxY(hui.frame)-1.5);
    self.baseTableView.tableHeaderView = headView1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 2;
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 226;
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString * cellIden = @"HotCircleTableViewCell";
    HotCircleTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellIden];
    if (cell == nil) {
        cell = [[HotCircleTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIden];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    cell.backgroundColor = [UIColor whiteColor];
    return cell;
}
-(void)release:(UIButton *)btn{
    
}
@end
